package com.ruoyi.back.controller.v3

import com.ruoyi.app.common.Data
import com.ruoyi.app.common.PageData
import com.ruoyi.back.service.v3.TemplateReportService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("system/templateReport")
@Api(tags = ["作品举报"])
class TemplateReportController {

    @Autowired
    private lateinit var templateReportService: TemplateReportService


    @ApiOperation("模板举报分页")
    @GetMapping("page")
    fun templateReportPage(templateReportSearchDto: TemplateReportService.TemplateReportSearchDto): PageData<TemplateReportService.TemplateReportListVo> =
        templateReportService.templateReportPage(templateReportSearchDto)

    @ApiOperation("审核模板举报")
    @PostMapping("checkTemplateReport")
    fun checkTemplateReport(@RequestBody checkTemplateDto: TemplateReportService.CheckTemplateDto): Data<Boolean> =
        templateReportService.checkTemplateReport(checkTemplateDto)

    @ApiOperation("移除模板举报")
    @GetMapping("remove/{ids}")
    fun removeCheckTemplate(@PathVariable ids: String): Data<Boolean> =
        templateReportService.removeCheckTemplate(ids)
}